/*
 * @Autor: fhx
 * @Date: 2021-06-15
 * @LastEditors: fhx
 * @LastEditTime: 2021-06-15
 */
import http from '@/utils/http/axios'
import qs from 'qs'
import { Base64 } from 'js-base64'
import { type } from './interface'
import setting from '@/config/defaultSettings'
const { clientId, clientSecret } = setting

/**
 * 获取机构树
 */
export function getOrgTree (params) {
  return  http.request<any>({
    url: '/app-admin/org/tree',
    method: 'GET',
    params
  })
}

/**
 * 获取机构列表
 */
export function getOrgList (params) {
  return  http.request<any>({
    url: '/app-admin/org/list',
    method: 'GET',
    params
  })
}

/**
 * 获取机构列表
 */
export function getOrgPage (params) {
  return  http.request<any>({
    url: '/app-admin/org/page',
    method: 'GET',
    params
  })
}

/**
 * 新增机构
 */
export function sysOrgAdd (params) {
  return  http.request<any>({
    url: '/app-admin/org/add',
    method: 'POST',
    params
  })
}

/**
 * 编辑机构
 */
export function sysOrgEdit (params) {
  return  http.request<any>({
    url: '/app-admin/org/edit',
    method: 'POST',
    params
  })
}

/**
 * 删除机构
 */
export function sysOrgDelete (params) {
  return  http.request<any>({
    url: '/app-admin/org/delete',
    method: 'POST',
    params
  })
}

